﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AddCategory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Label10.Visible = false;
    }

   
    protected void Button1_Click(object sender, EventArgs e)
    {

        ManagementCustomer m = new ManagementCustomer();
        if (m.CheckCustomerUsername(txtID.Text))
        {
            Label10.Visible = true;
            Label10.Text = "<span style='width: 200px;color:red;font-weight:bold;float: left;margin-left:10px;;margin-bottom:15px;'>Username was exits</span>";
            
        }
        else {
            if (m.AddCustomer(txtID.Text, txtName.Text, txtPhone.Text, txtEmail.Text, txtAddress.Text))
            {
                Label10.Visible = true;
                Label10.Text = "<span style='width: 200px;color:green;font-weight:bold;float: left;margin-left:10px;margin-bottom:15px;'>Add SuccerFully</span>";

            }
            else
            {
                Label10.Visible = true;
                Label10.Text = "<span style='width: 200px;color:red;font-weight:bold;float: left;margin-left:10px;;margin-bottom:15px;'>Add Failed</span>";
            }
           
        }
        
    }


    protected void DropDownList1_TextChanged(object sender, EventArgs e)
    {
        
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
       
    }
}